package cn.buk.tms.entity.config;

import cn.buk.tms.entity.base.BaseInfo;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint;

/**
 * 企业支付宝应用配置
 */
@Entity
@Table(name = "ent_alipay_config", uniqueConstraints = @UniqueConstraint(name = "uk_ent_alipay_config",
        columnNames = {"enterprise_id", "main_account", "app_id"}))
public class EntAlipayConfig extends BaseInfo {

    /**
     * 支付宝的主账号, 一般是email
     */
    @Column(name = "main_account", nullable = false, updatable = false)
    private String mainAccount;

    /**
     * 支付宝应用id
     */
    @Column(name = "app_id", nullable = false, updatable = false)
    private String appId;

    /**
     * 支付宝网关地址
     */
    @Column(name = "alipay_url")
    private String alipayUrl;

    /**
     * 私钥
     */
    @Column(name = "private_key", length = 2048)
    private String privateKey;

    /**
     *支付宝公钥
     *      * 注意：支付宝公钥和 应用的私钥对应的公钥不一样
     */
    @Column(name = "alipay_public_key", length = 2048)
    private String alipayPublicKey;

    /**
     * 支付宝异步通知地址
     */
    @Column(name = "notify_url")
    private String notifyUrl;

    /**
     * 支付宝同步通知地址
     */
    @Column(name = "return_url")
    private String returnUrl;


    public String getMainAccount() {
        return mainAccount;
    }

    public void setMainAccount(String mainAccount) {
        this.mainAccount = mainAccount;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getAlipayUrl() {
        return alipayUrl;
    }

    public void setAlipayUrl(String alipayUrl) {
        this.alipayUrl = alipayUrl;
    }

    public String getPrivateKey() {
        return privateKey;
    }

    public void setPrivateKey(String privateKey) {
        this.privateKey = privateKey;
    }

    public String getAlipayPublicKey() {
        return alipayPublicKey;
    }

    public void setAlipayPublicKey(String alipayPublicKey) {
        this.alipayPublicKey = alipayPublicKey;
    }

    public String getNotifyUrl() {
        return notifyUrl;
    }

    public void setNotifyUrl(String notifyUrl) {
        this.notifyUrl = notifyUrl;
    }

    public String getReturnUrl() {
        return returnUrl;
    }

    public void setReturnUrl(String returnUrl) {
        this.returnUrl = returnUrl;
    }
}
